package cn.foolishbird.hamal.frame.bsassert.info;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-12-13
 */
public enum SysInfo implements RstInfo {

    RUN_TIME(-1, "操作失败"),
    JSON_CONVERT_ERROR(-2, "对象格式错误"),
    DATE_FORMART_ERROR(-3, "日期格式错误"),
    FIELD_TYPE_NOT_SUPPORT(-4, "字段类型不支持转换"),
    WRAPPER_TYPE_NOT_SUPPORT(-4, "字段查询关系不支持"),
    SUCCESS(1, "success"),
    ;

    private int code;

    private String content;

    private Object data;

    private String errorMessage;

    SysInfo(int code, String content) {
        this.code = code;
        this.content = content;
    }

    SysInfo(int code, String content, Object data) {
        this.code = code;
        this.content = content;
        this.data = data;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String content() {
        return content;
    }

    @Override
    public Object data() {
        return this.data;
    }

    @Override
    public String errorMessage() {
        return this.errorMessage;
    }

}
